var requestFriend = new Function();
requestFriend.prototype = {
	init: function(req, res){
		switch(req.route.method)
		{
			case 'post':
				var id = req.param('id');
				var targetId = req.param('targetId');
				var requestFriend = new (Services('requestFriend'))(id, targetId, {
					success: function(data){
						res.send(data);
						res.end();
					},
					error: function(code, message){
						throw new Exception(code, message, function(){
							res.send(this.toString());
							res.end();
						});
					}
				});
				break;
				
			default:
				throw new Exception(9999, 'Not found url: '+req.route.url, function(){
					res.send(this.toString());
					res.end();
				});
				break;
		}
	}
};
module.exports = requestFriend;